
/*Function to check login field for errors:
 *  1)login:";.!#$%^&*"
 *///String with error chars
var ErrorString = "~!`!#$%^&*(><:?/\|<,."
  /*
   *  2)login wish consist less then 4 chars
   */
function loginCheck(login){
    for(i=0;i<ErrorString.length;i++){
        if(login.indexOf(ErrorString.charAt(i)==-1)){
            alert("Login error:error symbol "+ErrorString.charAt(i)+" on "+i+" position")
            return false;
        }
    }   
    return lengthCheck(login,4);
}

/* Function to check e-mail
 * has email asdress "@" or "."
 * and error chars
 */
function emailCheck(email){
    if((email.indexOf('@')==-1)||(email.indexOf('.')==-1||!loginCheck(email))){
        alert("Not vakid Email adress");
        return false;
    }
    return true;
}

/*Function for length of string
 *params min length
 *returns boolean from either lenght < min
*/
function lengthCheck(str,min){
    if(str.length<=min)
        return false;
    return true;
}
/*Function writes warning about password*/
function passwordStringWrite(type){
    switch(type){
        case 1: //unsafe
                
                break;
        case 2:break;
        case 3:break;
    }
}    

/*Function to check either 
 *password safe or not
 *checks lenght and variety of symbols
 */
function passwordCheck(password){
    
}